/**
 * Created by camiez on 2017/3/29.
 */
/**
 * Created by camiez on 2017/2/21.
 */
//导报后自动生成html并引入打包后的build.js文件
let htmlwpl = require('html-webpack-plugin')
module.exports = {
    linkActiveClass:'router-link-active',
    entry:'./main.js',       //入口函数
    output:{
        path:'./dist',       //出口路径
        filename:'build.js',   //打包后的文件
    },
    module:{
        //编译器
        loaders:[
            {
                test:/\.css$/,
                loader:'style-loader!css-loader'
            },
            {
                test:/\.js$/,
                loader:'babel',
                exclude:/node_modules/
            },
            {
                test:/\.less$/,
                loader:'style-loader!css-loader!less-loader'
            },
            {
                test:/\.(png|svg|gif|ttf|jpg|eot|woff|woff2)(\?\S*)?$/,
                loader:'url-loader?limit=4000'
            },
            {
                test:/\.vue$/,
                loader:'vue-loader'
            },
            {
                test: /vue-preview.src.*?js$/,
                loader: 'babel-loader'
            }

        ]
    },
    //es6转es5
    babel:{
        presets:['es2015'],
        plugins:['transform-runtime']
    },
    //插件
    plugins:[
        new htmlwpl({
            title:'首页',
            filename:'index.html',
            template:'./index.html'
        })
    ]
}